// Created by WXX on 2022/1/31 20:30
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    int numberOfSteps(int num) {
        if (!num) return 0;
        if (num % 2 == 0) return numberOfSteps(num / 2) + 1;
        return numberOfSteps(num - 1) + 1;
    }
};

int main() {

    cout << Solution().numberOfSteps(14) << endl;  // 6

    return 0;
}
